<template>
  <div class="home">
    <!-- 内容区域1 -->
    <div class="home-content">
      <!-- 左侧图片区域，始终显示 -->
      <div class="home-left">
        <div class="banner">
          <div class="freelancer-info">
            <div class="freelancer-images">
              <img src="/img/banner_find_worker1.jpg" alt="フリーランス" class="main-image">
            </div>
          </div>
        </div>
      </div>

      <!-- 右侧注册区域，仅未登录时显示 -->
      <div class="home-right" v-if="!isLoggedIn">
        <div class="register-box">
          <h2 class="register-title">新規会員登録</h2>
          <div class="register-subtitle">メールアドレスを入力してください</div>
          <el-form ref="emailFormRef" :model="emailForm" :rules="emailRules">
            <el-form-item prop="email">
              <el-input v-model="emailForm.email" placeholder="例如：mail@gmail.com">
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" class="register-button" style="width: 100%;"
                @click="goToRegister"> 今すぐ会員登録する（無料）</el-button>
            </el-form-item>
            <div class="register-note"><a href="/article/3">利用規約</a>および<a href="/article/2">個人情報の取り扱</a>いについて同意の上、登録してください。</div>
            <button class="button1">
              <span style="margin: 16px 0 0;padding: 8px 15px ;">働きたい方はこちら</span>
            </button>
          </el-form>
        </div>
      </div>
    </div>

    <!-- 内容区域2 -->
    <div class="work-types-container">
      <h2 class="work-types-title">仕事の種類は250種類以上、ご要望にあわせて発注できます。</h2>
      
      <!-- 顶部分类按钮 -->
      <div class="category-buttons">
        <button class="category-btn green">デザインの発注</button>
        <button class="category-btn orange">サイト制作の発注</button>
        <button class="category-btn blue">記事・データの発注</button>
      </div>

      <div class="work-types-columns">
        <!-- 第一列 -->
        <div class="work-type-column">
          <div class="work-type-item video-editing-special">
            <div class="work-type-header">
              <span class="header-text">Youtube・TikTok、アニメ、MV等。</span>
            </div>
            <div class="work-type-main">
              <div class="work-type-left">
                <h3>動画編集・制作</h3>
                <div class="work-type-details">
                  <p>短尺動画の場合</p>
                  <p>納期：最短3日</p>
                </div>
                <div class="work-type-price green"><span style="font-size: 23px;">1,000</span><span class="price-unit">円から</span></div>
              </div>
              <div class="work-type-right">
                <div class="work-type-images">
                  <img src="/img/worktype/1-0.png" alt="動画編集" class="main-video-img">
                </div>
              </div>
            </div>
          </div>

          <div class="work-type-item standard-card green-card">
            <div class="card-header">
              <div class="card-subtitle">ビジネスサービスから飲食店のロゴまで。</div>
            </div>
            <div class="card-main">
              <div class="card-left">
                <div class="card-title">ロゴ作成</div>
                <div class="card-description">平均<span style="font-size: 23px;">70</span>提案</div>
                <div class="card-price"><span style="font-size: 23px;">10,000</span><span class="price-unit">円から</span></div>
              </div>
              <div class="card-right">
                <img src="/img/worktype/1-1.png" alt="ロゴ作成" class="card-image">
              </div>
            </div>
          </div>

          <div class="work-type-item standard-card green-card">
            <div class="card-header">
              <div class="card-subtitle">キャラクターやゲームイラストも。</div>
            </div>
            <div class="card-main">
              <div class="card-left">
                <div class="card-title">イラスト・漫画作成</div>
                <div class="card-description">納期：10日前後</div>
                <div class="card-price"><span style="font-size: 23px;">3,000</span><span class="price-unit">円から</span></div>
              </div>
              <div class="card-right">
                <img src="/img/worktype/1-2.png" alt="イラスト・漫画作成" class="card-image">
              </div>
            </div>
          </div>
        </div>

        <!-- 第二列 -->
        <div class="work-type-column">
          <div class="work-type-item standard-card orange-card">
             <div class="card-header">
               <div class="card-subtitle">企業サイトやメディア、EC構築など。</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title" style="position: absolute;">ホームページ作成・サイト構築</div>
                 <div class="card-description" style="margin-top: 20px;">デザインから コーディングまで 納期：約1か月</div>
                 <div class="card-price"><span style="font-size: 23px;">200,000</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/2-0.png" alt="ホームページ作成" class="card-image">
               </div>
             </div>
           </div>

           <div class="work-type-item standard-card orange-card">
             <div class="card-header">
               <div class="card-subtitle">サイトの構築だけでなく、</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title">システム管理・保守・運用</div>
                 <div class="card-description"></div>
                 <div class="card-price"><span style="font-size: 23px;">100,000</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/2-1.png" alt="システム管理" class="card-image">
               </div>
             </div>
           </div>

           <div class="work-type-item standard-card orange-card">
             <div class="card-header">
               <div class="card-subtitle" style="margin-top: -15px;">スマートフォンアプリや<br>業務システム開発も。</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title">ソフトウェア・アプリ開発</div>
                 <div class="card-description"></div>
                 <div class="card-price"><span style="font-size: 23px;">300,000</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/2-2.png" alt="アプリ开发" class="card-image">
               </div>
             </div>
           </div>
        </div>

        <!-- 第三列 -->
        <div class="work-type-column">
          <div class="work-type-item standard-card blue-card">
             <div class="card-header">
               <div class="card-subtitle">オウンドメディアやブログ記事に。</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title">記事制作・ライティング</div>
                 <div class="card-description">専門記事やSEOも！<br>納期：5日前後</div>
                 <div class="card-price">記事<span style="font-size: 23px;">2,000</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/3-0.png" alt="記事制作" class="card-image">
               </div>
             </div>
           </div>

           <div class="work-type-item standard-card blue-card">
             <div class="card-header">
               <div class="card-subtitle">大勢の人の声を大量に集められる。</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title">アンケート調査・モニター</div>
                 <div class="card-description">約200人からの回答が集まる</div>
                 <div class="card-price"><span style="font-size: 23px;">50</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/3-1.png" alt="アンケート調査" class="card-image">
               </div>
             </div>
           </div>

           <div class="work-type-item standard-card blue-card">
             <div class="card-header">
               <div class="card-subtitle">名簿入力も、アンケートの集計も。</div>
             </div>
             <div class="card-main">
               <div class="card-left">
                 <div class="card-title">データ入力</div>
                 <div class="card-description">当日発注・翌日納品</div>
                 <div class="card-price">1件<span style="font-size: 23px;">10</span><span class="price-unit">円から</span></div>
               </div>
               <div class="card-right">
                 <img src="/img/worktype/3-2.png" alt="データ入力" class="card-image">
               </div>
             </div>
           </div>
        </div>
      </div>





      
    </div>
      <!-- 注册按钮处 -->
      <div class="register-button-section">
        <button class="main-register-button" @click="handleMainRegister">
          会員登録（無料）
        </button>
      </div>

      
    <!-- 内容区域3 -->
    <div class="home-content">
      <div class="home-left">
        <div class="banner">
          <div class="freelancer-info">
            <div class="freelancer-images">
              <img src="/img/home_banner2.png" alt="フリーランス" class="main-image">
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 内容区域4 - 根据参考图片实现的静态数据区域 -->
    <div class="home-content worker-showcase">
      <h2 class="worker-title">様々な知識や経験を持ったクラウドワーカーが多数登録！</h2>
      <div class="worker-cards">
        <div class="worker-card">
          <div class="worker-avatar">
            <img src="/img/1.png" alt="クラウドワーカー">
          </div>
          <div class="worker-info">
            <div class="worker-name">CHOCO * MINT</div>
            <div class="worker-role">ライター</div>
            <div class="worker-skills">【SEOライティング】オールジャンルで対応</div>
            <div class="worker-stats">
              <span class="completed">完了実績 <strong>1424 件以上</strong></span>
              <span class="hourly-rate">時給の目安 <strong>1,000円 〜</strong></span>
            </div>
          </div>
        </div>

        <div class="worker-card">
          <div class="worker-avatar">
            <img src="/img/2.jpg" alt="クラウドワーカー">
          </div>
          <div class="worker-info">
            <div class="worker-name">こある</div>
            <div class="worker-role">デザイナー</div>
            <div class="worker-skills">イラスト、POP、バナー、パッケージデザインや制作などが得意です。</div>
            <div class="worker-stats">
              <span class="completed">完了実績 <strong>843 件以上</strong></span>
              <span class="hourly-rate">時給の目安 <strong>1,000円 〜</strong></span>
            </div>
          </div>
        </div>

        <div class="worker-card">
          <div class="worker-avatar">
            <img src="/img/3.png" alt="クラウドワーカー">
          </div>
          <div class="worker-info">
            <div class="worker-name">わたなべ【ライター】</div>
            <div class="worker-role">ライター</div>
            <div class="worker-skills">ライター歴5年★専門知識で一緒に集客しましょう！</div>
            <div class="worker-stats">
              <span class="completed">完了実績 <strong>1293 件以上</strong></span>
              <span class="hourly-rate">時給の目安 <strong>2,000円 〜</strong></span>
            </div>
          </div>
        </div>

        <div class="worker-card">
          <div class="worker-avatar">
            <img src="/img/4.png" alt="クラウドワーカー">
          </div>
          <div class="worker-info">
            <div class="worker-name">坂江 優</div>
            <div class="worker-role">エンジニア</div>
            <div class="worker-skills">【開発・トラブルシュート】は任せて下さい！日本人エンジニアが対応しています</div>
            <div class="worker-stats">
              <span class="completed">完了実績 <strong>59 件以上</strong></span>
              <span class="hourly-rate">時給の目安 <strong>5,000円 〜</strong></span>
            </div>
          </div>
        </div>
      </div>

      <div class="view-more-container">
        <button class="view-more-button" @click="router.push('/find-work')">クラウドワーカーをもっと見る</button>
      </div>
      <!-- 内容区域5 - 回到顶部处 -->
    </div>
          <div class="category-section">
        <!-- 注册按钮 -->
        <div class="category-register-section">
          <button class="category-register-button" @click="handleMainRegister">
            まずは無料で会員登録
          </button>
        </div>
        
        <!-- 人気の仕事カテゴリ -->
        <div class="popular-categories">
          <h3 class="category-title">人気の仕事カテゴリ</h3>
          <div class="category-grid">
            <div class="category-column">
              <h4 class="column-title">動画・映像・アニメーション</h4>
              <ul class="category-links">
                <li><a href="#" @click.prevent="navigateToCategory('TikTok・短尺動画')">TikTok・短尺動画</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('YouTube動画作成・動画')">YouTube動画作成・動画</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('映像編集・映像制作')">映像編集・映像制作</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('映像撮影')">映像撮影</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('AR/VRコンテンツ制作・開発')">AR/VRコンテンツ制作・開発</a></li>
              </ul>
            </div>
            <div class="category-column">
              <h4 class="column-title">音楽・音響・ナレーション</h4>
              <ul class="category-links">
                <li><a href="#" @click.prevent="navigateToCategory('楽曲・ソングライン制作')">楽曲・ソングライン制作</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('作曲・音楽・効果音')">作曲・音楽・効果音</a></li>
              </ul>
            </div>
            <div class="category-column">
              <h4 class="column-title">ビジネス・マーケティング・企画</h4>
              <ul class="category-links">
                <li><a href="#" @click.prevent="navigateToCategory('リサーチ・分析・解析')">リサーチ・分析・解析</a></li>
                <li><a href="#" @click.prevent="navigateToCategory('営業・広告・PR')">営業・広告・PR</a></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
       <el-button
    v-loading.fullscreen.lock="fullscreenLoading"
    style="border: none;"
  >
  </el-button>
    <!-- 使用在线客服组件 -->
    <CustomerService />
  </div>
</template>

<script setup>
import { ref, reactive, computed, onMounted } from 'vue'
import { ElMessage,ElLoading } from 'element-plus'
import { userApi } from '../api/index'
import { useRouter } from 'vue-router'
import { Message } from '@element-plus/icons-vue'
import CustomerService from '../components/CustomerService.vue'

const router = useRouter()

// 判断用户是否已登录
const isLoggedIn = computed(() => {
  return !!localStorage.getItem('token')
})

// 邮箱表单
const emailFormRef = ref(null)
const emailForm = reactive({
  email: ''
})

// 邮箱验证规则
const emailRules = {
}
const fullscreenLoading = ref(false)
const openFullScreen1 = () => {
  fullscreenLoading.value = true
  setTimeout(() => {
    fullscreenLoading.value = false
  }, 2000)
}
// 跳转到注册页面第二步
const goToRegister = () => {
  emailFormRef.value.validate((valid) => {
    if (valid) {
      // 将邮箱存储到 localStorage，以便在注册页面使用
      localStorage.setItem('registerEmail', emailForm.email)
      // 跳转到注册页面
      router.push('/register')
    }
  })
}

// 主注册按钮点击事件
const handleMainRegister = () => {
  // 直接跳转到注册页面
  router.push('/register')
}

// 分类跳转功能
const navigateToCategory = (categoryName) => {
  // 跳转到FindWork页面，并传递分类参数
  router.push({
    path: '/find-work',
    query: {
      category: categoryName
    }
  })
}

// 回到顶部功能
const scrollToTop = () => {
  window.scrollTo({
    top: 0,
    behavior: 'smooth'
  })
}

// 获取用户信息并保存到本地
const getUserInfo = async () => {
  openFullScreen1()
  try {
    // 检查是否有token，没有则不请求
    const token = localStorage.getItem('token')
    if (!token) return

    const res = await userApi.getBankAccount()
    if (res.code === 1 && res.data) {
      console.log(res.data.company_name)
      // 将用户信息保存到本地存储
      const userInfo = {
        credit: res.data.credit || 100,
        balance: parseFloat(res.data.money) || 0,
        freeze_money: parseFloat(res.data.freeze_money) || 0,
        workOrders: res.data.order_int || 0,
        taskLists: res.data.jobs_int || 0,
        payments: parseFloat(res.data.recharge_money) || 0,
        withdrawals: parseFloat(res.data.withdrawal_money) || 0,
        transactions: res.data.details_money_int || 0,
        grow: res.data.grow || 0,
        bank: res.data.banks|| null,
        type:res.data.type,
        company:res.data.company_name || null
      }
      console.log(userInfo)
      // 将用户信息转为JSON字符串并保存到localStorage
      localStorage.setItem('accountInfo', JSON.stringify(userInfo))
      console.log('账号信息已保存到本地存储', userInfo)
    } else if (res.code === 401) {
      // token过期，清除本地token
      localStorage.removeItem('token')
      localStorage.removeItem('userInfo')
    }
  } catch (error) {
    console.error('获取用户信息失败:', error)
  }
}



// 页面加载时获取用户信息
onMounted(() => {
  getUserInfo()
})
</script>

<style scoped>
.button1{
    margin-top: 16px;
    border-radius: 0;
    color: #085591;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    background-color: white;
    width: 233px;
    border: 1px solid rgb(224, 224, 224);
}
.button1:hover{
  background-color: #d1d2d2;
}
.header-text{
  font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,Segoe UI,Hiragino Sans,Noto Sans,Noto Sans CJK JP,Meiryo,sans-serif;
    font-size: 14px;
    color: #3D4449;
    margin-bottom: 5px;
    line-height: 1.4;
    text-align: center;
    font-weight: bolder;
}
.home {
  min-height: calc(100vh - 120px);
  /* 减去头部和底部的高度 */
  background-color: #f5fafd;
}

.home-content {
  max-width: 1000px;
  margin: 0 auto;
  /* max-height: 700px; */
  display: flex;
  padding: 20px 0;
  /* margin-bottom: 20px; */
  background-color: #f5fafd;
}

.home-left {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #fff;
  border-radius: 4px 0 0 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.home-right {
  font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,Segoe UI,Hiragino Sans,Noto Sans,Noto Sans CJK JP,Meiryo,sans-serif;
  flex: 1;
  max-width: 265px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.banner {
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  color: #333;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.freelancer-info {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
  /* margin-left: 100%; */
}

.freelancer-title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.no1 {
  color: #1e50a2;
  font-size: 36px;
  font-weight: 800;
  margin-left: 5px;
}

.freelancer-subtitle {
  font-size: 18px;
  color: #333;
  margin-bottom: 30px;
}

.freelancer-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  z-index: 0;
  position: relative;
}

.main-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  z-index: 0;
  position: relative;
}

.register-box {
  width: 100%;
}

.register-title {
  font-size: 16px;
  margin-bottom: 0.5rem;
  text-align: center;
  margin-top: -160px;
  color: #333;
  font-weight: bold;
}

.register-subtitle {
  font-size: 10px;
  color: #666;
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-tip {
  margin-bottom: 0.5rem;
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

.register-button {
  height: 44px;
  font-size: 14px;
  background-color: #ff6600;
  border-color: #ff6600;
  font-weight: bold;
  margin-top: -0.2rem;
}

.register-button:hover {
  background-color: #e65c00;
  border-color: #e65c00;
}

.register-note {
    box-sizing: border-box;
    color: #333;
    display: inline-block;
    font-size:12px;
    letter-spacing: normal;
    line-height: 1.8;
    margin-bottom: 0;
    margin-top: -18px;
    padding: 0 10px;
    text-align: center;
    font-weight: 200;
}

.register-options {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.login-link {
  color: #409eff;
  text-decoration: none;
  font-size: 0.9rem;
}

.login-link:hover {
  text-decoration: underline;
}

/* 主注册按钮样式 */
.register-button-section {
  display: flex;
  justify-content: center;
  margin: 40px 0;
  padding: 0 20px;
}

.main-register-button {
  background-color: #ff6600;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 80px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
  min-width: 300px;
}

.main-register-button:hover {
  background-color: #e65c00;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

.main-register-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

/* 分类区域样式 */
.category-section {
  background-color: #f8f9fa;
  padding: 40px 20px;
  margin-top: 40px;
}

.category-register-section {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.category-register-button {
  background-color: #ff6600;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 40px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.category-register-button:hover {
  background-color: #e65c00;
  transform: translateY(-1px);
}

.popular-categories {
  max-width: 1000px;
  margin: 0 auto;
}

.category-title {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 30px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

.category-column {
  text-align: left;
}

.column-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  border-bottom: 2px solid #ff6600;
  padding-bottom: 5px;
}

.category-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-links li {
  margin-bottom: 8px;
}

.category-links a {
  color: #085591;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s ease;
}

.category-links a:hover {
  color: #0056b3;
  text-decoration: none;
}

.back-to-top {
  text-align: center;
  margin-top: 30px;
}

.back-to-top a {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

.back-to-top a:hover {
  text-decoration: underline;
}

/* 内容区域3 - 工作者展示区域样式 */
.worker-showcase {
  max-width: 1000px;
  height: auto;
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  border-radius: 4px;
  padding: 30px 20px;
  /* margin-top: 20px; */
  /* margin-bottom: 80px; */
}

.worker-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-bottom: 30px;
}

.worker-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.worker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(25% - 15px);
  background-color: #fff;
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.3s ease;
}

.worker-card:hover {
  transform: translateY(-5px);
}

.worker-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.worker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.worker-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.worker-name {
  font-size: 18px;
  font-weight: bold;
  color: #1e50a2;
  margin-bottom: 5px;
}

.worker-role {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.worker-skills {
  font-size: 12px;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.4;
  max-width: 100%;
}

.worker-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #666;
  width: 100%;
}

.worker-stats strong {
  color: #ff6600;
  font-weight: bold;
}

.completed {
  margin-bottom: 5px;
}

.view-more-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.view-more-button {
    min-width: 240px;
    height: auto;
    padding: .8125rem 2.5rem;
    font-size: 1.23rem;
    color: #3d4449;
    letter-spacing: .04em;
    border-radius: 4px;
    background-color: #fff;
    border-color: #d1d0d0;
    box-sizing: border-box;
    border:1px solid #d1d0d0;
}

.view-more-button:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* 内容区域4 - 工作类型 */
.work-types-container {
  width: 100%;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 0;
}

.work-types-title {
color: #3d4449;
    font-size: 2rem;
    line-height: 1.44;
    letter-spacing: .07938em;
    text-align: center;
    margin: 0 0 2.5rem;
}

/* 顶部按钮样式 */
.category-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 30px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.category-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 318.96px;
  text-align: center;
}

.category-btn.green {
  background: #4CAF50;
}

.category-btn.orange {
  background: #FF9800;
}

.category-btn.blue {
  background: #2196F3;
}

.category-btn:hover {
  transform: translateY(-2px);
}

.work-types-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1024px) {
   .register-title{
    margin-top: 0;
  }
    .home-right{
    min-width: 100% !important;
    /* width: 100%; */
    height: auto;
  }
    .main-video-img{
    position: absolute;
    top: 60%;
    left: 80%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .work-types-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .work-type-item.video-editing-special .work-type-main {
    flex-direction: column;
    text-align: center;
  }
  
  .work-type-item.video-editing-special .work-type-left {
    padding-right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 768px) {
  .main-video-img{
    position: absolute;
    top: 60%;
    left: 80%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .button1{
    margin: auto;
    width: 100%;
    /* margin-left: 40px; */
  }
  .register-title{
    margin-top: 0;
  }
  .home-right{
    min-width: 100% !important;
    /* width: 100%; */
    height: auto;
  }
  .work-types-columns {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .category-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .category-btn {
    min-width: 120px;
    padding: 8px 16px;
  }
  
  .work-type-item.video-editing-special .work-type-main {
    flex-direction: column;
    text-align: center;
  }
  
  .work-type-item.video-editing-special .work-type-left {
    padding-right: 0;
    margin-bottom: 10px;
  }
  
  .work-type-item.standard-card {
    min-height: 120px;
  }
  
  .work-type-item.standard-card .card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .work-type-item.standard-card .card-image {
    width: 90px;
    height: 90px;
  }
}

.work-type-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.work-type-card {
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  color: white;
}

.work-type-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.work-type-card.green {
  background-color: #1abc9c;
}

.work-type-card.orange {
  background-color: #f39c12;
}

.work-type-card.blue {
  background-color: #3498db;
}

.work-type-item {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
  position: relative;
  margin-bottom: 15px;
}

/* 视频编辑特殊卡片样式 */
.work-type-item.video-editing-special {
  background: white;
  height: 180px;
  display: flex;
  flex-direction: column;
}

.work-type-item.video-editing-special .work-type-header {
  color: #333;
  padding: 8px 15px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  position: relative;
}

.work-type-item.video-editing-special .work-type-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px;
  height: 3px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
}

.work-type-item.video-editing-special .work-type-main {
  display: flex;
  padding: 15px;
  align-items: flex-start;
  flex: 1;
  gap: 15px;
}

.work-type-item.video-editing-special .work-type-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.work-type-item.video-editing-special .work-type-left h4 {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: #333;
  text-align: left;
}

.work-type-item.video-editing-special .work-type-details {
  margin-bottom: 15px;
  flex-grow: 1;
  
}

.work-type-item.video-editing-special .work-type-details p {
  margin: 2px 0;
  font-size: calc(13px + 1 * (100vw - 320px) / 1120);
  font-weight: 600;
  line-height: 1.38888;
  color: #666;
}

.work-type-item.video-editing-special .work-type-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.work-type-item.video-editing-special .main-video-img {
  width: 140px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

.work-type-item.video-editing-special .work-type-price {
  color: #4CAF50;
  font-size: 18px;
  font-weight: bold;
  display: block;
  text-align: left;
  margin-top: auto;
}

.work-type-item.video-editing-special .price-unit {
  font-size: 14px;
  font-weight: normal;
  color: #4CAF50;
}

/* 统一所有价格单位样式 */
.price-unit {
  font-size: 14px;
  font-weight: normal;
}

/* 标准卡片样式 */
.work-type-item.standard-card {
  padding: 15px;
  height: 180px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: white;
}

.work-type-item.standard-card .card-header {
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 8px;
}

.work-type-item.standard-card .card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.work-type-item.standard-card .card-subtitle {
  font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,Segoe UI,Hiragino Sans,Noto Sans,Noto Sans CJK JP,Meiryo,sans-serif;
  font-size: 14px;
  color: #3D4449;
  margin-bottom: 5px;
  line-height: 1.4;
  text-align: center;
  font-weight: bolder;
}

.work-type-item.standard-card .card-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  flex: 1;
}

.work-type-item.standard-card .card-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.work-type-item.standard-card .card-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.work-type-item.standard-card .card-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  text-align: left;
}

.work-type-item.standard-card .card-description {
  font-size: calc(13px + 1 * (100vw - 320px) / 1120);
  font-weight: 600;
  line-height: 1.38888;
  color: #666;
  margin-bottom: 2px;
  text-align: left;
}

.work-type-item.standard-card .card-price {
  font-size: 18px;
  font-weight: bold;
  display: block;
  text-align: left;
  margin-top: -10px;
}

.work-type-item.standard-card .card-image {
  width: 140px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

/* 绿色卡片 */
.work-type-item.green-card {
  background: white;
}

.work-type-item.green-card .card-header::after {
  background: linear-gradient(135deg, #4CAF50, #45a049);
}

.work-type-item.green-card .card-price {
  color: #4CAF50;
}

/* 橙色卡片 */
.work-type-item.orange-card {
  background: white;
}

.work-type-item.orange-card .card-header::after {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}

.work-type-item.orange-card .card-price {
  color: #ff9800;
}

/* 蓝色卡片 */
.work-type-item.blue-card {
  background: white;
}

.work-type-item.blue-card .card-header::after {
  background: linear-gradient(135deg, #2196f3, #1976d2);
}

.work-type-item.blue-card .card-price {
  color: #2196f3;
}

.work-type-item:hover {
  transform: translateY(-5px);
}

.work-type-image {
  display: none;
  /* 隐藏原来的图片容器 */
}

.work-type-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.work-type-content {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 70px);
  /* 确保内容不会与背景图重叠 */
}

.work-type-content h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
}

.work-type-content p {
  margin: 0 0 5px 0;
  font-size: 12px;
  color: #666;
}

.work-type-price {
  margin-top: auto;
  font-size: 14px;
  font-weight: bold;
}
.work-type-price.blue {
  color: #3498db;
}
.work-type-price.orange {
  color: #f39c12;
}
.work-type-price.green {
  color: #2ecc71;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .home-content {
    flex-direction: column;
    padding: 10px;
  }

  .home-left {
    min-height: 400px;
    border-radius: 4px 4px 0 0;
  }

  .home-right {
    min-width: auto;
    width: 100%;
    padding: 1.5rem;
    border-radius: 0 0 4px 4px;
  }

  .freelancer-title {
    font-size: 24px;
  }

  .no1 {
    font-size: 30px;
  }

  .freelancer-subtitle {
    font-size: 16px;
  }

  .worker-card {
    width: calc(50% - 10px);
    margin-bottom: 20px;
  }

  .worker-title {
    font-size: 22px;
  }

  .worker-avatar {
    width: 110px;
    height: 110px;
  }

  .worker-name {
    font-size: 16px;
  }

  /* 内容区域4响应式 */
  .work-types-columns {
    flex-wrap: wrap;
  }

  .work-type-column {
    flex: 0 0 calc(50% - 10px);
    margin-bottom: 20px;
  }

  .work-types-title {
    font-size: 22px;
  }

  .work-type-card h3 {
    font-size: 16px;
  }

  .work-type-item {
    background-size: 120px 120px;
  }

  .work-type-content {
    max-width: calc(100% - 60px);
  }
}



@media (max-width: 576px) {
  .home-content {
    padding: 5px;
  }
  
  .work-type-image img {
    max-width: 120px;
    max-height: 120px;
  }

  .home-left {
    min-height: 300px;
  }

  .freelancer-title {
    font-size: 20px;
  }

  .no1 {
    font-size: 26px;
  }

  .freelancer-subtitle {
    font-size: 14px;
    margin-bottom: 15px;
  }

  .register-title {
    font-size: 1.3rem;
  }

  .register-subtitle {
    font-size: 0.8rem;
  }

  .worker-title {
    font-size: 18px;
  }

  .worker-cards {
    flex-direction: column;
  }

  /* 主注册按钮响应式 */
  .register-button-section {
    margin: 20px 0;
    padding: 0 10px;
  }

  .main-register-button {
    min-width: 250px;
    padding: 14px 60px;
    font-size: 16px;
  }

  /* 分类区域响应式 */
  .category-section {
    padding: 20px 10px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .category-register-button {
    min-width: 180px;
    padding: 10px 30px;
    font-size: 14px;
  }

  .worker-card {
    width: 100%;
    margin-bottom: 15px;
  }

  .worker-avatar {
    width: 100px;
    height: 100px;
  }

  .worker-name {
    font-size: 16px;
  }

  .worker-skills {
    font-size: 11px;
  }

  /* 内容区域4响应式 */
  .work-types-container {
    margin: 30px auto;
  }

  .work-types-title {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .work-types-columns {
    flex-direction: column;
    gap: 15px;
  }

  .work-type-column {
    flex: 1 0 100%;
    margin-bottom: 0;
  }

  .work-type-item {
    flex-direction: column;
    background-size: 120px 120px;
    background-position: right bottom;
    padding-bottom: 50px;
    /* 为底部背景图留出空间 */
  }

  .work-type-image {
    width: 100%;
    height: 80px;
  }

  .work-type-content {
    padding: 10px;
    text-align: center;
    max-width: 100%;
  }
}
</style>